package bma.common.netty.thrift.dual.sample;

import org.apache.thrift.TException;

import bma.common.langutil.ai.stack.AIStack;
import bma.common.langutil.ai.stack.AIStackPrint;
import bma.common.netty.thrift.dual.NTSClient;
import bma.common.netty.thrift.dual.NTSRequest;
import bma.common.netty.thrift.dual.impl.NTSBaseProcessor;
import bma.common.thrift.sample.HelloImpl;

public class HelloTestImpl extends HelloImpl {

	@Override
	public boolean say(AIStack<Boolean> stack, String word) throws TException {
		boolean r = stack.success(true);
		NTSRequest req = NTSBaseProcessor.currentRequest();
		if (req != null) {
			NTSClient cl = req.getClient();
			if (cl != null) {
				Hello4NTS.Client o = new Hello4NTS.Client(cl, "hello");
				o.say(new AIStackPrint<Boolean>("HelloTestImpl.say"), word);
			}
		}
		return r;
	}
}
